//
//  SecondViewController.m
//  UITableView作业
//
//  Created by dllo on 16/7/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()
@property (nonatomic,strong) UITextField *textField;
//@property (nonatomic,strong) UITextField *field2;
//@property (nonatomic,strong) UITextField *field3;
//@property (nonatomic,strong) UITextField *field4;
//@property (nonatomic,strong) NSString *contentsView;
@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UITextField *field1 = [[UITextField alloc] initWithFrame:CGRectMake(50, 100, 100, 30)];
    field1.backgroundColor = [UIColor blackColor];
    field1.alpha = 0.2;
    field1.text = @"请输入用户名";
    field1.textColor = [UIColor whiteColor];
    
    UITextField *field2 = [[UITextField alloc] initWithFrame:CGRectMake(50, 200, 100, 30)];
    field2.backgroundColor = [UIColor blackColor];
    field2.alpha = 0.2;
    field2.text = @"性别";
    field2.textColor = [UIColor whiteColor];
    
    
    UITextField *field3 = [[UITextField alloc] initWithFrame:CGRectMake(50, 300, 100, 30)];
    field3.backgroundColor = [UIColor blackColor];
    field3.text = @"年龄";
    field3.alpha = 0.2;
    field3.textColor = [UIColor whiteColor];
    
    UITextField *field4 = [[UITextField alloc] initWithFrame:CGRectMake(50, 400, 100, 30)];
    field4.text = @"电话号码";
    field4.textColor = [UIColor blackColor];
    field4.alpha = 0.2;
    field4.textColor = [UIColor whiteColor];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(300, 30, 60, 30);
    button.backgroundColor = [UIColor redColor];
    [button setTitle:@"保存" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonClicked) forControlEvents:UIControlEventTouchUpInside];
}

- (void)buttonClicked
{

    [self.secondDelegate changeValue:self.textField.text];
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
